package com.hoshiicloud.auth.feign.fallback;

import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hoshiicloud.UsersLoginVO;
import com.hoshiicloud.auth.feign.UserFeignService;
import com.hoshiicloud.auth.vo.TokenUsersVO;
import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.user.dto.userCenter.MemberDto;
import com.hoshiicloud.user.entity.company.ComUsers;
import com.hoshiicloud.user.entity.company.Company;
import com.hoshiicloud.user.entity.company.Member;
import com.hoshiicloud.user.entity.platform.PlatUsers;
import com.hoshiicloud.user.param.PlatUsersParam;
import com.hoshiicloud.user.param.company.CompanyPageParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class HystrixUserFeignFallback implements UserFeignService {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public Response<TokenUsersVO> getPlatformMemberUser(Map<String, Object> map) {
        return null;
    }

    @Override
    public Response<UsersLoginVO> getSysUser(String userName) {
        logger.error("hoshiicloud-auth服务Feign调用hoshiicloud-user服务{}异常:{}", "UserFeignService.getSysUser",
                "{入参参数userName:" + userName + "}");
        return null;
    }

    @Override
    public Response<UsersLoginVO> getComUser(String userName) {
        logger.error("hoshiicloud-auth服务Feign调用hoshiicloud-user服务{}异常:{}", "UserFeignService.getComUser",
                "{入参参数userName:" + userName + "}");
        return null;
    }

    @Override
    public Response<TokenUsersVO> getStoreMemberUser(Map<String, Object> map) {
        return Response.failed("获取店铺用户信息失败");
    }

    @Override
    public Response<TokenUsersVO> getCompanyUser(Map<String, String> map) {
        return Response.failed("获取租户用户信息失败");
    }

    @Override
    public Response<Page<PlatUsers>> getPlatUsersPage(PlatUsersParam param) {
        return Response.failed("获取平台用户信息失败");
    }

    /**
     * 根据手机号码查询租户会员
     *
     * @param mobile 手机号码
     * @return Response
     */
    @Override
    public Response<MemberDto> getMemberByMobile(Long companyId, String mobile) {
        return Response.failed("根据手机号码查询租户会员信息失败");
    }

    @Override
    public Response<List<Member>> getMemberList(Member param) {
        return Response.failed("根据参数查询租户会员信息列表失败");
    }

    @Override
    public Response<Page<Company>> getCompanyList(CompanyPageParam param) {
        return Response.failed("...");
    }

    @Override
    public Response getCompanyUserList(String subDomain, String userName, String password) {
        return Response.failed("...");
    }

    @Override
    public Response getCompanyUserListByModel(ComUsers comUsers) {
        return Response.failed("...");
    }
}
